<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>登录认证</title>
<meta name="description" content="" />
<meta name="author" content="Administrator" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />

<link rel="stylesheet" href="/ext/style/base.css" type="text/css"
	media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="/ext/style/common.css" type="text/css"
	media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="/ext/style/device.css" type="text/css"
	media="screen" title="no title" charset="utf-8" />
<link rel="stylesheet" href="/ext/style/jquery.bxslider.css"
	type="text/css" media="screen" title="no title" charset="utf-8" />

<script src="/ext/js/jquery-1.7.2.min.js" type="text/javascript"
	charset="utf-8"></script>
<script src="/ext/layer/layer.js"></script>
</head>
<body>
	<!--Begin Header Begin-->
	<div class="back_bg">
		<table border="0" style="width: 92%; color: #FFF; margin: 0 auto;"
			cellspacing="0" cellpadding="0">
			<tr>
				<td style="text-align: center; font-size: 1.2em;">认证</td>
			</tr>
		</table>
	</div>
	<!--End Header End-->
	<div class="l_logo">
		<img src="/ext/images/aa.jpg">
	</div>
	<div class="login_bg">
		<div>
			<div class="log_tab">
				<div class="log_c">
					<table border="0" style="width: 100%; font-size: 1.4em;"
						cellspacing="0" cellpadding="0">
						<tr>
							<td width="40" class="log_c_img"><img
								src="/ext/images/l_1.png"></td>
							<td width="65" style="text-indent: 8px;">账号：</td>
							<td><input id="username" type="text" value=""
								placeholder="请输入账号" class="l_ipt"></td>
						</tr>
					</table>
				</div>
				<div class="log_c" style="border-bottom: 0;">
					<table border="0" style="width: 100%; font-size: 1.4em;"
						cellspacing="0" cellpadding="0">
						<tr>
							<td width="40" class="log_c_img"><img
								src="/ext/images/l_2.png"></td>
							<td width="65" style="text-indent: 8px;">密码：</td>
							<td><input id="password" type="password" value=""
								placeholder="请输入密码" class="l_ipt"></td>
						</tr>
					</table>
				</div>
			</div>
			<table border="0" style="width: 91%; margin: 5% auto 0 auto;"
				cellspacing="0" cellpadding="0">
				<tr height="50">
				</tr>
				<tr height="60">
					<td><button id="login" class="l_btn">认证</button>
				</tr>
			</table>
		</div>
	</div>
	<div></div>
	<script type="text/javascript">
		$("#login").click(function() {
			var username = $("#username").val();
			var password = $("#password").val();
			if (username == null || username == '') {
				layer.alert('用户名不能为空', {
					closeBtn : 0
				});
				return;
			}
			if (password == null || password == '') {
				layer.alert('密码不能为空', {
					closeBtn : 0
				});
				return;
			}
			$.ajax({
				type : 'POST',
				url : '/login',
				data : {
					username : username,
					password : password
				},
				success : function(data) {
					if (data.code == 1) {
						layer.alert('认证成功', {
							closeBtn : 0
						},function() {
							document.location = 'http://www.baidu.com/';
						});
					} else {
						layer.alert('认证失败', {
							closeBtn : 0
						});
					}
				}
			})
		})
	</script>
</body>
</html>